<?php

declare(strict_types=1);

namespace App\Model;

use Hyperf\DbConnection\Model\Model;

/**
 *  App渠道管理
 */
class AppChannel extends Model
{
    protected $table = 'app_channel';

    /**
     * 获取当前有效渠道
     */
    static function getAllChannels($byPackage = false)
    {
        if (!$byPackage) return self::where('flag', 1)->pluck('channel')->toArray();
        else return self::where('flag', 1)->pluck('package_name', 'channel')->toArray();
    }
}
